<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>屠宰档口审核</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="assets/images/favicon.ico">

    <!-- App css -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/style_dark.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />
    <!-- layer插件 -->
    <link rel="stylesheet" type="text/css" href="plugins/layer2.4/skin/layer.css" />
    <link rel="stylesheet" type="text/css" href="plugins/layui2/css/layui.css" />

    <!-- datatables插件 -->
    <link href="plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
    <link href="plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
    <link href="plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />

    <script src="assets/js/modernizr.min.js"></script>

</head>

<body>

    <!-- Begin page -->
    <div id="wrapper">

        <!-- ========== 左边侧边栏代码 ========== -->
        <div class="left side-menu">

            <div class="slimscroll-menu" id="remove-scroll">

                <!-- LOGO -->
                <div class="topbar-left">
                    <a href="index.html" class="logo">
                        <span>
                                <img src="assets/images/logo.png" alt="" height="22">
                            </span>
                        <i>
                                <img src="assets/images/logo_sm.png" alt="" height="28">
                            </i>
                    </a>
                </div>

                <!-- 用户区域 -->
                <div class="user-box">
                    <!-- <div class="user-img">
							<img src="assets/images/users/avatar-1.jpg" alt="user-img" title="Mat Helme" class="rounded-circle img-fluid">
						</div>
						<h5><a href="#">超级管理员</a> </h5>
						<p class="text-muted">超管</p> -->
                </div>

                <!--- 侧边菜单 -->
                <div id="sidebar-menu">

                    <ul class="metismenu" id="side-menu">
                        <!-- 主页 -->
                        <li>
                            <a href="index.html">
                                <i class="fi-air-play"></i>
                                <!--<span class="badge badge-danger badge-pill float-right">7</span> -->
                                <span> 主页 | 控制台 </span>
                            </a>
                        </li>
                        <!-- 地图 -->
                        <li>
                            <a href="BigData.html"><i class="fi-location-2"></i> <span> 大数据展示 </span></a>
                        </li>
                        <!--脚标机监控-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-desktop"></i> <span> 脚标机监控 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="BarcodeMachineStatusList.html">脚标机监控</a></li>
                                <li><a href="BarcodeMachineSearchList.html">脚标机历史查询</a></li>
                                <li><a href="BarcodeMachineAlertList.html">报警信息记录</a></li>
                            </ul>
                        </li>
                        <!-- 基础数据管理 -->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-wpforms"></i> <span> 基础数据管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="SlaughterHouseList.html">屠宰市场管理</a></li>
                                <li><a href="ToMarketList.html">去向市场管理</a></li>
                                <li><a href="StallsList.html">档口管理</a></li>
                                <li><a href="AllBarcodeMachineList.html">脚标机管理</a></li>
                                <li><a href="BarcodeMachineList.html">脚标机关联信息管理</a></li>
                                <li><a href="IdCardList.html">ID卡数据管理</a></li>
                                <li><a href="PoultryCategoryList.html">禽类信息管理</a></li>
                            </ul>
                        </li>
                        <!--条形码发放回收记录-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-barcode"></i> <span> 条形码发放回收管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="BarcodeGrantList.html">条形码发放记录管理</a></li>
                                <li><a href="BarcodeRecoveryList.html">条形码回收记录管理</a></li>
                            </ul>
                        </li>
                        <!--脚标机发放回收-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-print"></i> <span> 脚标机发放回收管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="BarcodeMachineGrantList.html">脚标机发放管理</a></li>
                                <li><a href="BarcodeMachineRecoveryList.html">脚标机回收管理</a></li>
                            </ul>
                        </li>
                        <!--脚标机报废记录-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-wrench"></i> <span> 脚标机报废维修管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="BarcodeMachineRepairList.html">脚标机报修记录管理</a></li>
                                <li><a href="BarcodeMachineScrapList.html">脚标机报废记录管理</a></li>
                            </ul>
                        </li>
                        <!--ID卡发放管理-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-id-card"></i> <span> ID卡发放回收管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="IdCardGrantList.html">ID卡发放记录管理</a></li>
                                <li><a href="IdCardRecoveryList.html">ID卡回收记录管理</a></li>
                            </ul>
                        </li>
                        <!--贴码管理-->
                        <li>
                            <a href="LabelingRecordList.html"><i class="fa fa-qrcode"></i> <span>贴标信息管理 </span></a>
                        </li>
                        <!--用户管理-->
                        <li>
                            <a href="javascript: void(0);"><i class="fa fa-user"></i> <span> 用户管理 </span> <span
										class="menu-arrow"></span></a>
                            <ul class="nav-second-level" aria-expanded="false">
                                <li><a href="SysUserList.html">用户信息管理</a></li>
                                <li><a href="SysUserRoleList.html">用户角色管理</a></li>
                            </ul>
                        </li>
                        <!--角色管理-->
                        <li>
                            <a href="SysRoleMenuList.html"><i class="fa fa-users"></i> <span> 角色权限管理 </span> </a>
                        </li>
                        <!--日志管理-->
                        <li>
                            <a href="LogRecordList.html"><i class="fa fa-qrcode"></i> <span>日志信息管理 </span></a>
                        </li>
                    </ul>
                    </li>
                    </ul>

                </div>
                <!-- Sidebar -->

                <div class="clearfix"></div>

            </div>
            <!-- Sidebar -left -->

        </div>
        <!-- Left Sidebar End -->

        <!-- ============================================================== -->
        <!-- 页面内容开始 -->
        <!-- ============================================================== -->

        <div class="content-page">

            <!-- 头部横条 -->
            <div class="topbar">

                <nav class="navbar-custom">

                    <ul class="list-unstyled topbar-right-menu float-right mb-0">
                        <!-- 通知 -->
                        <li class="dropdown notification-list">
                            <!-- <a class="nav-link dropdown-toggle arrow-none" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
                                <i class="fi-bell noti-icon"></i>
                                <span class="badge badge-danger badge-pill noti-icon-badge">4</span>
                            </a> -->
                            <div class="dropdown-menu dropdown-menu-right dropdown-menu-animated dropdown-lg">

                                <!-- item-->
                                <div class="dropdown-item noti-title">
                                    <h5 class="m-0"><span class="float-right"><a href="" class="text-dark"><small>Clear All</small></a> </span>Notification</h5>
                                </div>

                                <div class="slimscroll" style="max-height: 230px;">
                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-success"><i class="mdi mdi-comment-account-outline"></i></div>
                                        <p class="notify-details">Caleb Flakelar commented on Admin<small class="text-muted">1 min ago</small></p>
                                    </a>

                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-info"><i class="mdi mdi-account-plus"></i></div>
                                        <p class="notify-details">New user registered.<small class="text-muted">5 hours ago</small></p>
                                    </a>

                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-danger"><i class="mdi mdi-heart"></i></div>
                                        <p class="notify-details">Carlos Crouch liked <b>Admin</b><small class="text-muted">3 days ago</small></p>
                                    </a>

                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-warning"><i class="mdi mdi-comment-account-outline"></i></div>
                                        <p class="notify-details">Caleb Flakelar commented on Admin<small class="text-muted">4 days ago</small></p>
                                    </a>

                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-purple"><i class="mdi mdi-account-plus"></i></div>
                                        <p class="notify-details">New user registered.<small class="text-muted">7 days ago</small></p>
                                    </a>

                                    <!-- item-->
                                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                                        <div class="notify-icon bg-custom"><i class="mdi mdi-heart"></i></div>
                                        <p class="notify-details">Carlos Crouch liked <b>Admin</b><small class="text-muted">13 days ago</small></p>
                                    </a>
                                </div>

                                <!-- All-->
                                <a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
                                        View all <i class="fi-arrow-right"></i>
                                    </a>

                            </div>
                        </li>

                        <li class="dropdown notification-list tabUser">
                            <a class="nav-link dropdown-toggle nav-user" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
                                <span class="ml-1">超级管理员<i class="mdi mdi-chevron-down"></i> </span>
                            </a>
                            <div class="dropdown-menu dropdown-menu-right dropdown-menu-animated profile-dropdown">
                                <!-- item-->
                                <div class="dropdown-item noti-title">
                                    <h6 class="text-overflow m-0">欢迎使用</h6>
                                </div>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item notify-item">
                                    <i class="fi-head"></i> <span>我的信息</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item notify-item">
                                    <i class="fi-lock"></i> <span>锁屏</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item notify-item">
                                    <i class="fi-power"></i> <span>退出</span>
                                </a>

                            </div>
                        </li>

                    </ul>
                    <!-- 导航  -->
                    <ul class="list-inline menu-left mb-0">
                        <li class="float-left">
                            <button class="button-menu-mobile open-left disable-btn">
                                    <i class="dripicons-menu"></i>
                                </button>
                        </li>
                        <li>
                            <div class="page-title-box">
                                <h4 class="page-title">屠宰档口审核 </h4>
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="#">屠宰档口审核</a></li>
                                    <li class="breadcrumb-item active">屠宰档口审核列表</li>
                                </ol>
                            </div>
                        </li>

                    </ul>

                </nav>

            </div>
            <!-- 头顶标签结束 -->

            <!-- Start Page content -->
            <div class="content">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-12">
                            <div class="card-box">
                                <div class="card-body">
                                    <button class="m-t-0 float-left btn btn-primary radius" onclick="window_show('添加市场','SlaughterHouseAdd.html')"><i class="fa fa-plus"></i>添加市场信息</button>
                                    <button class="m-t-0 float-right btn btn-success radius btn-refresh" onclick="refresh()"><i class="fa fa-refresh fa-spin"></i></button>
                                </div>
                                <div class="card-body">

                                    <table id="datatable" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                                        <thead>
                                            <tr>
                                                <th>市场ID</th>
                                                <th>市场名称</th>
                                                <th>市场所在区县</th>
                                                <th>市场地址</th>
                                                <th>负责人</th>
                                                <th>创建者</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>

                                        <tbody id="tbody">
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- end row -->
                </div>
                <!-- container -->

            </div>
            <!-- content -->

            <footer class="footer">

            </footer>

        </div>

        <!-- ============================================================== -->
        <!-- End Right content here -->
        <!-- ============================================================== -->

    </div>
    <!-- END wrapper -->

    <!-- jQuery  -->
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/bootstrap.bundle.min.js"></script>
    <script src="assets/js/metisMenu.min.js"></script>
    <script src="assets/js/waves.js"></script>
    <script src="assets/js/jquery.slimscroll.js"></script>

    <!-- App js -->
    <script src="assets/js/custom.js" type="text/javascript" charset="utf-8"></script>
    <script src="assets/js/jquery.core.js"></script>
    <script src="assets/js/jquery.app.js"></script>

    <!-- layer插件 -->
    <script src="plugins/layer2.4/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugins/layui2/layui.js" type="text/javascript" charset="utf-8"></script>

    <!-- datatables插件 -->
    <script src="plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="plugins/datatables/dataTables.bootstrap4.min.js"></script>
    <script src="plugins/datatables/dataTables.responsive.min.js"></script>
    <script src="plugins/datatables/responsive.bootstrap4.min.js"></script>

    <script type="text/javascript">
        var datatable;
        //初始化表格
        function initData() {
            var url = window.location.pathname; //获取url
            url = decodeURI(url.split("/")[1]);

            $.ajax({
                type: "GET",
                url: URL + 'slaughterHouse',
                async: false,
                dataType: "json",

                beforeSend: function(xhr) {
                    xhr.setRequestHeader("Authorization", 'Bearer/${url}');
                },

                success: function(data) {
                    data = data.object
                    for (var i = 0; i < data.length; i++) {

                        for (var key in data[i]) {
                            if (data[i][key] == null || data[i][key] == undefined) {
                                data[i][key] = '';
                            }
                        }
                        var tbody = $('<tr class="text-c">' +
                            '<td>' + data[i].id + '</td>' +
                            '<td>' + data[i].name + '</td>' +
                            '<td>' + data[i].district + '</td>' +
                            '<td>' + data[i].address + '</td>' +
                            '<td>' + data[i].userName + '</td>' +
                            '<td>' + data[i].creatBy + '</td>' +
                            '<td class="td-manage">' +
                            '<a title="审核通过" href="javascript:;" onclick="approved(\'slaughterHouse/agreePublishs?ids=\',\'' + data[i].id + '\')" class="ml-1" style="text-decoration:none"><i class="fa fa-edit "></i>审核通过</a>' +
                            '<a title="审核不通过" href="javascript:;" onclick="disapproved(\'slaughterHouse/agreeDeleteS?ids=\',\'' + data[i].id + '\')" class="ml-1" style="text-decoration:none"><i class="fa fa-trash"></i>审核不通过</a>' +
                            '</td>' +
                            '</tr>')
                        $("tbody").append(tbody)
                    }

                    $("#datanum").text(data.length)

                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    networkError(XMLHttpRequest, textStatus, errorThrown)
                }
            });

            datatable = $('#datatable').DataTable({
                "aaSorting": [
                    [0, "desc"]
                ], //默认第几个排序
                "bStateSave": true, //状态保存
                "aoColumnDefs": [
                    //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                    {
                        "orderable": false,
                        "aTargets": [5]
                    } // 制定列不参与排序
                ]
            });
        }
        $(document).ready(function() {
            initData()
            // getRole()
            operateExcel(layui,'slaughterHouse/uploadExcel', 'slaughterHouse/downloadExcel')
        })

        function refresh() {
            datatable.clear(); //销毁datatable
            datatable.destroy(); //销毁datatable
            initData() //重新加载数据
        }
    </script>

</body>

</html>